Add GitHub Actions CI which lints json files
using official ESLint json plugin.
Signed-off-by: Yanase Yuki <[email protected]>
--- /dev/null
+---
+name: "LuCI repo ESLint JSON Analysis"
+
+on:
+ push:
+ branches: [ "master" ]
+ path:
+ - '**/*.json'
+ pull_request:
+ branches: [ "master" ]
+ path:
+ - '**/*.json'
+permissions: {}
+
+jobs:
+ eslint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: latest
+
+ - name: Install ESLint
+ run: npm install --no-audit --no-fund --save-dev eslint@latest @eslint/json@latest
+
+ # Currently, we lint JSON only.
+ - name: Run ESLint
+ run: npx eslint **/*.json
+
modules/luci-compat/src/plural_formula.h
docs/jsapi/*
!docs/jsapi/README.md
-**eslint.config**
\ No newline at end of file
+**eslint.config**
+!eslint.config.mjs
--- /dev/null
+import { defineConfig } from "eslint/config";
+import json from "@eslint/json";
+
+export default defineConfig([
+ {
+ files: ["**/*.json"],
+ ignores: ["package-lock.json"],
+ plugins: { json },
+ language: "json/json",
+ extends: ["json/recommended"],
+ },
+]);
+